/* The code is based on the following paper:                                                                                                            */
/*   Chen, T. Y., Lin, Y. L., and Tzeng, L. Y., forthcoming.                                                                                    */
/*   Estimating probability weighting functions through option pricing bounds. Review of Asset Pricing Studies. */
/*                                                                                                                                                                               */
/* Copyright: Tzu-Ying Chen, Yo-Lan Lin, Larry Y. Tzeng                                                                                    */
/* Date: January 30, 2024                                                                                                                                         */

libname OM 'E:\WRDS Data\���Y��\';

%MACRO DY (FileName); 
PROC PRINTTO log = "E:\WRDS Data\Record_DY.log";
RUN;

data dy;
set OM.&FileName;
where secid = 108105;
run;

data dy;
set dy;
keep secid date rate;
run;

data dy;
set dy; 
rate = rate / 100;
run;

PROC SORT DATA = dy OUT = dy NODUPKEY;
BY secid date;
RUN; 

data _null_;                                         
set dy;                                        
file "E:\WRDS Data\IndexDivYield19962021.txt";
put secid date rate;
run;

%MEND DY;

%DY (IndexDivYield1996202302);
